import Vue from 'vue'
import App from './App.vue'
// 共通filters
import * as filters from './filters'
// 公共方法
import common from '@/utils/common'
// 路由
import router from './router'
// vuex
import store from './store/index'
// 请求
import axios from '@/utils/axios'
import API from '@/api'
// rem转换
import './utils/rem'
// UI框架
import './components/vantComponents'


Vue.use(common)
Object.entries(filters).forEach(([key, value]) => {
  Vue.filter(key, value)
})

Vue.prototype.$_http = axios
Vue.prototype.$_API = API
Vue.config.productionTip = false

router.beforeEach(async (to, from, next) => {
  console.warn(to.name, to);
  try {
  } catch (error) {
    console.error(error);
  }
  next();
});

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
